package com.yuanfeng.order.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanfeng.commoms.vo.goods.GoodsDetailsListVO;
import com.yuanfeng.order.dto.OrderReturnPlatformListDTO;
import com.yuanfeng.order.entity.OrderReturnPlatformEntity;
import com.yuanfeng.order.vo.OrderReturnPlatformVO;
import com.yuanfeng.order.vo.ReturnOrderDetailVO;
import com.yuanfeng.order.vo.ReturnOrderDetailsVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @Entity com.yuanfeng.order.entity.OrderReturnPlatform
 */
@Mapper
public interface OrderReturnPlatformMapper extends BaseMapper<OrderReturnPlatformEntity> {

    /**
     * 更新返回订单
     *
     * @param orderReturnPlatform
     * @return
     */
    Integer updateOrderReturnBuyerVoucher(@Param("param") OrderReturnPlatformVO orderReturnPlatform);

    /**
     * 新增返回订单
     *
     * @param orderReturnPlatform
     * @return
     */
    Integer insertOrderReturnPlatform(@Param("param") OrderReturnPlatformVO orderReturnPlatform);

    /**
     * 查询订单返回平台
     *
     * @param orderId
     * @return
     */
    OrderReturnPlatformVO selectOrderReturnPlatform(String orderId);

    /**
     * 查询商品返回详情
     *
     * @param orderId
     * @return
     */
    ReturnOrderDetailVO queryOrderReturnDetail(@Param("orderId") String orderId);

    /**
     * 查询商品集合
     *
     * @param orderId
     * @return
     */
    List<GoodsDetailsListVO> queryGoodsList1(@Param("orderId") String orderId);

    /**
     * 通过店铺id查询数量
     *
     * @param shopId
     * @return
     */
    Integer queryShopIdByCount(@Param("shopId") Integer shopId);

    /**
     * 检查干预
     *
     * @param platform
     * @return
     */
    Integer examineIntervention(@Param("param") OrderReturnPlatformVO platform);

    /**
     * 查询分销佣金
     *
     * @param orderId
     * @return
     */
    Map<String, Object> queryFXCommon(@Param("orderId")String orderId);

    /**
     * 分页查询交易维权列表
     * @param page
     * @param platformListr
     * @return
     */
    IPage<OrderReturnPlatformListDTO> selectreturnplatform(Page<OrderReturnPlatformListDTO> page,@Param("param") OrderReturnPlatformListDTO platformListr);

    /**
     * 查询订单返回数量
     * @param orderId
     * @return
     */
    Integer selectOrderReturnPlatform1(@Param("orderId") String orderId);

    /**
     * 查询用户售后商品
     * @param orderId
     * @return
     */
    List<Integer> queryReturnGoods(@Param("orderId")String orderId);


    /**
     * 查询平台介入 商家超时未处理 退货申请
     *
     * @return
     */
    List<ReturnOrderDetailsVO> updateTimeOutReturnplatform();


    /**
     * 更新微客用户佣金业绩
     *
     * @param param
     * @return
     */
    int updateVkCommissionReturn(@Param("param") Map<String, Object> param);



    List<ReturnOrderDetailsVO> updateTimeOutReturnfundplatform();
}




